//
//  BaseCollectionVC.h
//  ocCrazy
//
//  Created by mac on 2018/7/4.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "BaseViewController.h"

#import "BaseCollectionReusableView.h"

@class BaseModel;

@protocol BaseCollectionVCInterface <NSObject>

- (NSArray <NSArray <NSString *> *> *)classArr;


@optional
- (NSInteger)sectionCount;

- (NSInteger)itemsCount:(NSInteger)section;

- (void)collectionViewSelectAtIndexPath:(NSIndexPath *)indexPath;

- (__kindof BaseModel *)modelForCell:(NSIndexPath *)indexPath;

- (__kindof BaseModel *)modelForHeader:(NSInteger)section;

- (NSArray <NSString *>*)headerAndFooter;

- (NSArray <NSNumber *>*)noHeader;

@end



@interface BaseCollectionVC : BaseViewController

@property (nonatomic,weak) IBOutlet UICollectionView * collectionView;

@property (nonatomic,weak) IBOutlet UICollectionViewFlowLayout * flowLayout;

@property (nonatomic,weak) id <BaseCollectionVCInterface> collectionInterface;

@property (nonatomic,strong) NSMutableArray * dataSouece;

@property (nonatomic,strong) void(^cellEvent)(int key,id value);
@property (nonatomic,strong) void(^reusableViewEvent)(id key,id data);

- (void)needRefresh;

- (void)reloadCollectionView;
- (void)reloadCollectionViewAndHeaderFooter;
- (void)repeatGetData;
- (void)detailModelwithArr:(NSArray <__kindof BaseModel *> *)arr withCallBack:(void(^)(void))callBack;

@end
